package com.learn.temp.JVM;

import java.util.ArrayList;

public class HeapTest {
    byte[] a = new byte[1024 * 100];//每一个数组占用100k内存空间

    public static void main(String[] args) throws InterruptedException {
        ArrayList<HeapTest> l = new ArrayList<>();
        int i = 0;
        byte[] allocation1, allocation2/*, allocation3, allocation4, allocation
5, allocation6*/;
        allocation1 = new byte[29280 * 1024];
        allocation2 = new byte[1000 * 1024];
        /*allocation3 = new byte[1000*1024];
10  allocation4 = new byte[1000*1024];
11  allocation5 = new byte[1000*1024];
12  allocation6 = new byte[1000*1024];*/
        while (true) {
            l.add(new HeapTest());
            Thread.sleep(2000);
            System.out.println(i++);
        }
    }
}